package com.fudan.biz.visualize.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fudan.biz.visualize.dao.SettingDao;
import com.fudan.biz.visualize.entity.Setting;
import com.fudan.framework.base.BaseDao;
import com.fudan.framework.base.DaoService;

/**
 * @ClassName: PileController
 * @Description: TODO
 * @Author: DavidDong
 * @Date: 2019/4/13 22:47
 **/

@Service
public class SettingService extends DaoService<Setting> {

    @Autowired
    private SettingDao settingDao;

//    public void addRoleWithPermission(Role role, String[] permissionId) {
//        roleDao.save(role);
//        if (permissionId != null) {
//            for (String permission : permissionId) {
//                roleDao.insertPermission(role.getId(), permission);
//            }
//        }
//    }
//
//    @Transactional
//    public void updateRoleWithPermission(Role role, String[] permissionId) {
//        update(role);
//        roleDao.deleteById(role.getId());
//        if (permissionId != null) {
//            for (String permission : permissionId) {
//                roleDao.insertPermission(role.getId(), permission);
//            }
//        }
//    }

    public String getThemeName(Integer themeStatus) {
        return settingDao.getThemeName(themeStatus);
    }

    @Override
    protected BaseDao<Setting> injectDao() {
        return settingDao;
    }
}
